<?php 

namespace EmailDelivery;

use Users\Profile;
/**
 * Created by ITokarev
 * 
 * Базовый Модуль для отправки почты
 */

class IndexAction extends \Action
{
    protected static $isPublic = true;
    
	protected static $layout = "#layouts.column2White";

	static function pullParams()
	{
		return ['identity'];
	}
	
	protected function run()
	{
		$config = \EmailDeliveryConfig::$config;
		
		$configTemplateTypes = $config['templateTypes'];
		
		foreach ($configTemplateTypes as $key => $type)
		{
			$item = array_search('@userId@', $type['defaultParams']);
			$config['templateTypes'][$key]['defaultParams'][$item] = $this->request->_identity;
		}
		
		$this->response->config = $config;
	}
}